// 民主测评

import { GET as get, POST as post } from '../axios.config.js'
const base = config.ip
const projectName = '/topnet-assess'

/* 民主测评 开始 */
// 获取人员列表
export const listAssessmentPerson = p => get(`${base}${projectName}/sa-assessment-person/listAssessmentPerson`, p)

// 新增或者修改
export const saveOrEditAssessmentPerson = p =>
  post(`${base}${projectName}/sa-assessment-person/saveOrEditAssessmentPerson`, p)

// 删除人员信息
export const delAssessmentPerson = p => get(`${base}${projectName}/sa-assessment-person/delAssessmentPerson`, p)

// 导入
export const batchImportAssessmentPerson = p =>
  post(`${base}${projectName}/sa-assessment-person/batchImportAssessmentPerson`, p)

// 新建测评
export const saveAssessment = p => post(`${base}${projectName}/sa-assessment/saveAssessment`, p)

// 删除被测评人员信息
export const delAssessmentPersonBcp = p => get(`${base}${projectName}/sa-assessment/delAssessmentPerson`, p)

// 新建测评
export const updateOrder = p => get(`${base}${projectName}/sa-assessment/updateOrder`, p)

// 获取机构下民主测评的列表数据
export const listAssessmentData = p => get(`${base}${projectName}/sa-assessment/listAssessmentData`, p)

// 删除
export const delAssessment = p => get(`${base}${projectName}/sa-assessment/delAssessment`, p)

// 获取民主测评的详情信息
export const getAssessmentDetail = p => get(`${base}${projectName}/sa-assessment/getAssessmentDetail`, p)

// 获取发布页详情
export const getAssessmentVoteDetail = p => post(`${base}${projectName}/sa-assessment/getAssessmentVoteDetail`, p)

// 获取季度选择信息
export const listQuarterSelect = p => get(`${base}${projectName}/sa-assessment/listQuarterSelect`, p)

// 修改测评的基础信息
export const updateAssessment = p => post(`${base}${projectName}/sa-assessment/updateAssessment`, p)

// 发布民主测评
export const releaseAssessment = p => post(`${base}${projectName}/sa-assessment/releaseAssessment`, p)

// 获取测评结果数据
export const listAssessmentResult = p => get(`${base}${projectName}/sa-assessment-result/listAssessmentResult`, p)
// 获取测评签到统计数据
export const listAssessmentSignFormVO = p =>
  get(`${base}${projectName}/sa-assessment-result/listAssessmentSignFormVO`, p)
// 获取测评结果数据-组织部
export const listAssessmentResultOrgan = p =>
  get(`${base}${projectName}/sa-assessment-result/listAssessmentResultOrgan`, p)
// 获取测评签到统计数据-组织部
export const listAssessmentSignFormVOOrgan = p =>
  get(`${base}${projectName}/sa-assessment-result/listAssessmentSignFormVOOrgan`, p)
// 动态获取二维码
export const getSignUrl = p =>
  post(`${base}${projectName}/sa-assessment/getSignUrl`, p, {
    Headers: {
      hideLoading: true,
    },
  })

// 获取机构列表-组织部
export const listAssessmentOrgan = p => post(`${base}${projectName}/sa-assessment-result/listAssessmentOrgan`, p)
// 下载
export const downQrcode = (p, p1) => post(`${base}${projectName}/sa-assessment/download/downQrcode`, p, p1)

// 暂停收集
export const updateAssessmentStatus = p => get(`${base}${projectName}/sa-assessment/updateAssessmentStatus`, p)

// 导出测评结果数据
export const downAssessmentData = p => `${base}${projectName}/sa-assessment-result/download/downAssessmentData${p}`
// 导出测评结果数据-组织部
export const downAssessmentDataOrg = p =>
  `${base}${projectName}/sa-assessment-result/download/downAssessmentDataOrg${p}`

// 导出测评签到数据
export const downAssessmentSign = p => `${base}${projectName}/sa-assessment-result/download/downAssessmentSign${p}`
// 导出测评签到数据-组织部
export const downAssessmentSignOrg = p =>
  `${base}${projectName}/sa-assessment-result/download/downAssessmentSignOrg${p}`

// 人员名单模板下载
export const downAssessmentPersonFile = p =>
  `${base}${projectName}/sa-assessment-result/download/downAssessmentPersonFile${p}`

// 获取机构列表-组织部
export const listUserData = p => post(`${base}${projectName}/sa-uias-user-status/listUserData`, p)
// export const listUserData = (p) => post(`${base}/public-uias-back/uias-user/listUserDataBody`, p);
// 特殊状态( 3退休 4调离 6离职)变更保存对应审核信息
export const userChangeStatus = p => post(`${base}${projectName}/sa-uias-user-status/userChangeStatus`, p)
// 发送新增、修改用户消息
export const sendUserChangeStatusMsg = p => post(`${base}${projectName}/sa-uias-user-status/sendUserChangeStatusMsg`, p)
// 查询用户审核状态
export const getDetail = p => get(`${base}${projectName}/sa-uias-user-status/getDetail`, p)
// 用户审核状态
export const updateUserStataus = p => post(`${base}${projectName}/sa-uias-user-status/updateUserStataus`, p)
// 获取用户被操作的日志
export const listUserOperLog = p => post(`${base}${projectName}/sa-uias-user-status/listUserOperLog`, p)
// 获取原来机构的职位信息
export const getInOrgPostId = ({ id, orgId }) =>
  get(`${base}${projectName}/sa-uias-user-status/getInOrgPostId`, {
    id,
    orgId,
  })
// 修改用户管理调入其他待办状态 id：待办id
export const updateOtherDeal = ({ id }) => get(`${base}${projectName}/sa-uias-user-status/updateOtherDeal`, { id })
// 导出用户管理数据
export const exportPersonnelStructure = p =>
  `${base}${projectName}/sa-uias-user-status/skipValidation/exportPersonnelStructure${p}`

// 获取全量待评价成员列表
export const listAllAssessmentMember = ({ id }) =>
  post(`${base}${projectName}/sa-assessment-person/listAllAssessmentMember`, {
    id,
  })

// 更新待评价成员列表
export const updateAssessMember = p => post(`${base}${projectName}/sa-assessment-person/updateAssessMember`, p)

// 更新民主测评审核状态
export const updateAssessmentCheckStatus = p =>
  post(`${base}${projectName}/sa-assessment/updateAssessmentCheckStatus`, p)

// 组织部获取各单位民主测评审核列表
export const orgGetAssessmentData = p => get(`${base}${projectName}/sa-assessment/orgGetAssessmentData`, p)

// 根据单次民主测评获取结果数据
export const listResultByAssessmentId = p =>
  get(`${base}${projectName}/sa-assessment-result/listResultByAssessmentId`, p)

// 检查民主测评是否符合提交审核条件
export const checkSubmitCondition = p => post(`${base}${projectName}/sa-assessment/checkSubmitCondition`, p)

// 更新民主测评数据有效状态
export const updateAssessmentDataStatus = p => post(`${base}${projectName}/sa-assessment/updateAssessmentDataStatus`, p)
